<?php

/**
 * security actions.
 *
 * @package    pasajeros
 * @subpackage security
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
 */
class securityActions extends sfActions
{
  /**
   * Executes index action
   *
   */
  public function executeIndex()
  {	
	$this->form = new SecurityForm();

    return sfView::SUCCESS;
  }
  
  public function executeLogin($request)
  {
    if ($this->getRequestParameter('name') == 'sanziniafilms' && $this->getRequestParameter('password') == 'madagascar')
    {
      $this->getUser()->setAuthenticated(true);
   
      return $this->redirect('trayectoria/index');
    }
    else
    {
      //$this->getRequest()->setError('login', 'incorrect entry');
   
      return $this->forward('security', 'index');
    }
  }
  
    public function executeLogout($request)
  {
	$this->getUser()->setAuthenticated(false);
	 return $this->redirect('trayectoria/index');
  }
  
}
